# bash shell function completion                           -*- shell-script -*-

_function()
{
    local cur prev words cword
    _init_completion || return

    if ((cword == 1)); then
        COMPREPLY=($(compgen -A function -- "$cur"))
    else
        COMPREPLY=("() $(type -- ${words[1]} | command sed -e 1,2d)")
    fi
} &&
    complete -F _function function

# ex: filetype=sh
